<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>07.vue中使用插槽</title>
</head>
<body>
    <div id="app">
        <body-content>
            <div class="header" slot="header">header</div>
            <div class="footer" slot="footer">footer</div>
        </body-content>
    </div>
</body>
<script src="vue.js"></script>
<script>
    Vue.component('body-content', {
        template: `<div>
                <slot name='header'>default header</slot>
                <div class='content'>content</div>
                <slot name='footer'>default footer</slot>
            </div>`
    })
    var app = new Vue({
        el: '#app',
        data: {
            
        }
    })
</script>
</html>